//
//  ViewControllerBase.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/11.
//  Copyright © 2021 moon. All rights reserved.
//

#import "ViewControllerBase.h"

@interface ViewControllerBase ()

@end

@implementation ViewControllerBase
- (id)init{
    if(self=[super init]){
        MKTFuncItem *item = [self.class funcItem];
        self.tabBarItem.title = item.name;
        self.tabBarItem.image = [[item.iconImage mk_scaleImageToAspectFillSize:CGSizeMake(30, 30)] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        self.title = item.name;
    }
    return self;
}
+ (MKTFuncItem *)funcItem{
    return [MKTFuncItem funcWithName:NSStringFromClass(self) viewControllerClass:self];
}
- (CGRect)safeBounds{
    CGRect fullBounds = self.view.bounds;
    CGRect bounds = fullBounds;
    if (@available(iOS 11.0, *)) {
        bounds = self.view.safeAreaLayoutGuide.layoutFrame;
    } else {
    }
    return bounds;
}
- (void)viewDidLoad{
    [super viewDidLoad];
    self.view.backgroundColor = UIColor.mk_listViewBackgroundColor;
    NSLog(@"viewDidLoad:%@",NSStringFromClass(self.class));
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    NSLog(@"viewWillAppear:%@,animated:%@",NSStringFromClass(self.class),@(animated));
}
- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    NSLog(@"viewDidAppear:%@,animated:%@",NSStringFromClass(self.class),@(animated));
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    NSLog(@"viewWillDisappear:%@,animated:%@",NSStringFromClass(self.class),@(animated));
}
- (void)viewDidDisappear:(BOOL)animated{
    [super viewDidDisappear:animated];
    NSLog(@"viewDidDisappear:%@,animated:%@",NSStringFromClass(self.class),@(animated));
}
@end
